<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
      body>div{
        width: 400px;
        height: 400px;
        border: 3px solid red;
        overflow: hidden;
      }
      #d1{
        width: 100px;
        height: 100px;
        border: 3px solid blue;
        margin-left: 50px;
        margin-top: 50px;
        float: left;

        font-size: 40px;

      }

      #d2{
        width: 100px;
        height: 100px;
        border: 3px solid green;
        margin-left: 130px;
        margin-top: 50px;
          float: left;
        font-size: 40px;
      }

    </style>
</head>
<body>
  <div>
    <div id="d1">1</div>
    <div id="d2">2</div>
  </div>
</body>
</html>